package com.sinat.flowable.controller;

import com.alibaba.fastjson.JSON;
import com.sinat.flowable.mapper.FlowableCommonMapper;
import com.sinat.flowable.vo.ProcessDefinitionVo;
import com.sinat.flowable.vo.ProcessInstanceQueryVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TestController{

    @Resource
    private FlowableCommonMapper flowableCommonMapper;
    @GetMapping(value = "/test")
    @ResponseBody
    public String list() {
        ProcessInstanceQueryVo vo = new ProcessInstanceQueryVo();
        vo.setUserId("admin");
        List<ProcessDefinitionVo> vos = flowableCommonMapper.listMyInvolvedSummary(vo);
        System.out.println(vos.size());
        String json = JSON.toJSONString(vos);
        return json;
    }


}
